obj=write-records read-records add-year

all: $(obj)

prebuild: write-record.s read-record.s \
	write-newline.s count-chars.s
	as -g write-record.s -o write-record.o
	as -g read-record.s -o read-record.o
	as -g write-newline.s -o write-newline.o
	as -g count-chars.s -o count-chars.o

write-records: write-records.s prebuild
	as -g write-records.s -o write-records.o
	ld write-records.o write-record.o \
	write-newline.o -o write-records


read-records: read-records.s prebuild	
	as -g read-records.s -o read-records.o
	ld read-record.o count-chars.o write-newline.o \
	read-records.o -o read-records


add-year: add-year.s prebuild
	as -g add-year.s -o add-year.o
	ld add-year.o read-record.o write-record.o \
	write-newline.o -o add-year

clean:
	-rm $(obj) *.o
